<template >
  <div>
    <div id="topdiv">
      <div id="bb">
        <el-breadcrumb separator-class="el-icon-arrow-right">
          <el-breadcrumb-item :to="{ path: '/admin' }">首页</el-breadcrumb-item>
          <el-breadcrumb-item>停车位管理</el-breadcrumb-item>
          <el-breadcrumb-item>车位使用管理</el-breadcrumb-item>
        </el-breadcrumb>
      </div>

      <div id="vv">
        <el-button
          size="mini"
          type="primary"
          @click="flash()"
          class="el-icon-refresh"
        ></el-button>
      </div>
    </div>
    <hr />

    <div id="we">
      <!-- <h2>UserInfo to java 2005</h2> -->
      <el-form :inline="true" :model="fromLise" class="demo-form-inline">
        <el-form-item label="所属小区">
          <el-select v-model="fromLise.comId" style="width: 250px">
            <el-option
              v-for="name in names1"
              :key="name.id"
              :label="name.comName"
              :value="name.id"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="业主姓名" :label-width="formLabelWidth">
          <el-select v-model="fromLise.ownerId" filterable style="width: 250px">
            <el-option
              v-for="unames in username1"
              :key="unames.id"
              :label="unames.uname"
              :value="unames.id"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click="onLikeFind" class="el-icon-thumb"
            >查询</el-button
          >
        </el-form-item>
      </el-form>
    </div>
    <div id="div1">
      <div id="div2">
        <el-button
          size="mini"
          type="danger"
          slot="reference"
          @click="deleteChoose"
          class="el-icon-delete"
          >批量删除</el-button
        >
        <el-button
          size="mini"
          type="primary"
          @click="addUse"
          class="el-icon-circle-plus-outline"
          >添加</el-button
        >
      </div>
      <div id="div3">
        共有数据:<a type="primary">{{ parks.length }}</a
        >条
      </div>
    </div>

    <div id="divtable">
      <el-table
        :data="
          parks.slice((currentPage - 1) * pagesize, currentPage * pagesize)
        "
        style="width: 100% ,border-right:1px solid gray;"
        @selection-change="handleSelectionChange"
      >
        <el-table-column
          type="selection"
          width="120"
          style="border-right: 1px solid gray"
        >
        </el-table-column>
        <el-table-column label="ID" show-overflow-tooltip>
          <template slot-scope="scope">
            <!-- <i class="el-icon-time"></i> -->
            <span style="margin-left: 10px">{{ scope.row.id }}</span>
          </template>
        </el-table-column>
        <el-table-column label="所属小区" show-overflow-tooltip>
          <template slot-scope="scope">
            <!-- <i class="el-icon-time"></i> -->
            <span style="margin-left: 10px">{{
              scope.row.community.comName
            }}</span>
          </template>
        </el-table-column>
        <el-table-column label="车位编号" show-overflow-tooltip>
          <template slot-scope="scope">
            <!-- <i class="el-icon-time"></i> -->
            <span style="margin-left: 10px">{{ scope.row.spaceNum }}</span>
          </template>
        </el-table-column>
        <el-table-column label="车牌号码" show-overflow-tooltip>
          <template slot-scope="scope">
            <!-- <i class="el-icon-time"></i> -->
            <span style="margin-left: 10px">{{ scope.row.car.carCard }}</span>
          </template>
        </el-table-column>
        <el-table-column label="车牌照片" show-overflow-tooltip>
          <template slot-scope="scope" align="center">
            <el-popover
              align="left"
              placement="top-start"
              title=""
              trigger="hover"
            >
              <img
                :src="scope.row.car.cardPicture"
                alt=""
                style="width: 150px; height: 150px"
              />
              <img
                class="llimg"
                slot="reference"
                :src="scope.row.car.cardPicture"
                style="width: 100px; height: 30px"
              />
            </el-popover>
            <!-- <i class="el-icon-time"></i>  -->
            <!-- <span style="margin-left: 10px">{{ scope.row.car.cardPicture  }}</span> -->
          </template>
        </el-table-column>
        <el-table-column label="车辆所有人" show-overflow-tooltip>
          <template slot-scope="scope">
            <!-- <i class="el-icon-time"></i>  -->
            <span style="margin-left: 10px">{{ scope.row.owner.uname }}</span>
          </template>
        </el-table-column>
        <el-table-column label="联系方式" show-overflow-tooltip>
          <template slot-scope="scope">
            <!-- <i class="el-icon-time"></i>  -->
            <span style="margin-left: 10px">{{ scope.row.owner.tel }}</span>
          </template>
        </el-table-column>
        <el-table-column label="使用性质" show-overflow-tooltip>
          <template slot-scope="scope">
            <!-- <i class="el-icon-time"></i>  -->
            <span style="margin-left: 10px">{{ scope.row.ifUser }}</span>
          </template>
        </el-table-column>
        <el-table-column label="总费用" show-overflow-tooltip>
          <template slot-scope="scope">
            <!-- <i class="el-icon-time"></i>  -->
            <span style="margin-left: 10px">{{ scope.row.total }}</span>
          </template>
        </el-table-column>

        <el-table-column label="开始时间" show-overflow-tooltip>
          <template slot-scope="scope">
            <!-- <i class="el-icon-time"></i> -->
            <span style="margin-left: 10px">{{ scope.row.statTime }}</span>
          </template>
        </el-table-column>
        <el-table-column label="截止时间" show-overflow-tooltip>
          <template slot-scope="scope">
            <!-- <i class="el-icon-time"></i> -->
            <span style="margin-left: 10px">{{ scope.row.endTime }}</span>
          </template>
        </el-table-column>
        <el-table-column label="创建时间" show-overflow-tooltip>
          <template slot-scope="scope">
            <!-- <i class="el-icon-time"></i> -->
            <span style="margin-left: 10px">{{
              scope.row.parking.creationTime
            }}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="primary"
              @click="handleEdit(scope.$index, scope.row)"
              class="el-icon-edit"
              >编辑</el-button
            >
            <br />
            <!-- <el-button
              size="mini"
              type="danger"
              @click="handleDelete(scope.$index, scope.row)"
              class="el-icon-delete"
              >删除</el-button
            > -->
            <el-button
              size="mini"
              type="danger"
              slot="reference"
              @click="deleteOne(scope.$index, scope.row)"
              class="el-icon-delete"
              >删除</el-button
            >
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div class="block">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-sizes="[2, 5, 10, 20, 40]"
        :page-size="pagesize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="parks.length"
      >
      </el-pagination>
    </div>
    <!-- 模态窗体 -->
    <div>
      <el-dialog title="停车位" :visible.sync="dialogFormVisible">
        <el-form :model="park">
          <el-form-item label="ID" :label-width="formLabelWidth">
            <el-input
              v-model="park.id"
              autocomplete="off"
              readonly="true"
            ></el-input>
          </el-form-item>
          <el-form-item label="所属小区" :label-width="formLabelWidth">
            <el-input
              v-model="park.comName"
              autocomplete="off"
              readonly="true"
            ></el-input>
          </el-form-item>
          <el-form-item label="车位编号" :label-width="formLabelWidth">
            <el-input
              v-model="park.spaceNum"
              autocomplete="off"
              readonly="true"
            ></el-input>
          </el-form-item>
          <el-form-item label="车牌号码" :label-width="formLabelWidth">
            <el-input
              v-model="park.carCard"
              autocomplete="off"
              readonly="true"
            ></el-input>
          </el-form-item>
          <!-- <el-form-item label="车牌照片" :label-width="formLabelWidth">
            <el-input v-model="park.cardPicture" autocomplete="off"></el-input>
          </el-form-item> -->
          <el-form-item label="车辆所有人" :label-width="formLabelWidth">
            <el-input
              v-model="park.uname"
              autocomplete="off"
              readonly="true"
            ></el-input>
          </el-form-item>
          <el-form-item label="联系方式" :label-width="formLabelWidth">
            <el-input
              v-model="park.tel"
              autocomplete="off"
              readonly="true"
            ></el-input>
          </el-form-item>
          <el-form-item label="状态" :label-width="formLabelWidth">
            <el-radio-group v-model="park.ifUser">
              <el-radio label="售出"></el-radio>
              <el-radio label="闲置"></el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="总费用" :label-width="formLabelWidth">
            <el-input v-model="park.total" autocomplete="off"></el-input>
          </el-form-item>
          <el-form-item label="创建时间" :label-width="formLabelWidth">
            <el-input
              v-model="park.creationTime"
              autocomplete="off"
              readonly="true"
            ></el-input>
          </el-form-item>
          <el-form-item label="开始时间" :label-width="formLabelWidth">
            <!-- <el-input v-model="park.statTime" autocomplete="off"></el-input> -->
            <el-date-picker
              v-model="park.statTime"
              format="yyyy-MM-dd HH:mm:ss"
              value-format="yyyy-MM-dd HH:mm:ss"
              type="date"
              placeholder="选择日期"
              style="width: 730px"
            ></el-date-picker>
          </el-form-item>
          <el-form-item label="截止时间" :label-width="formLabelWidth">
            <!-- <el-input v-model="park.endTime" autocomplete="off"></el-input> -->
            <el-date-picker
              v-model="park.endTime"
              format="yyyy-MM-dd HH:mm:ss"
              value-format="yyyy-MM-dd HH:mm:ss"
              type="date"
              placeholder="选择日期"
              style="width: 730px"
            ></el-date-picker>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible = false">取 消</el-button>
          <el-button type="primary" @click="updatePark">确 定</el-button>
        </div>
      </el-dialog>
    </div>
    <!-- 模态窗体2 -->
    <div>
      <el-dialog title="停车位修改" :visible.sync="dialogFormVisible2">
        <el-form :model="stop">
          <!-- <el-form-item label="所属小区" :label-width="formLabelWidth">
            <el-input
              readonly="true"
              v-model="park.comName"
              autocomplete="off"
            ></el-input>
          </el-form-item> -->
          <el-form-item label="所属小区" :label-width="formLabelWidth">
            <el-select v-model="stop.community" filterable style="width: 730px">
              <el-option
                v-for="name in names"
                :key="name.id"
                :label="name.comName"
                :value="name.id"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="空闲车位" :label-width="formLabelWidth">
            <el-select v-model="stop.parking" filterable style="width: 730px">
              <el-option
                v-for="pf in parkfree"
                :key="pf.id"
                :label="pf.spaceName"
                :value="pf.id"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="业主姓名" :label-width="formLabelWidth">
            <el-select v-model="stop.owner" filterable style="width: 730px">
              <el-option
                v-for="unames in username"
                :key="unames.id"
                :label="unames.uname"
                :value="unames.id"
              >
              </el-option>
            </el-select>
          </el-form-item>

          <el-form-item label="已登记车辆车牌号" :label-width="formLabelWidth">
            <el-select v-model="stop.car" filterable style="width: 730px">
              <el-option
                v-for="car in carname"
                :key="car.id"
                :label="car.carCard"
                :value="car.id"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <!-- <el-form-item label="车位编号" :label-width="formLabelWidth">
            <el-input v-model="stop.spaceNum" autocomplete="off"></el-input>
          </el-form-item> -->
          <!-- <el-form-item label="车位名称" :label-width="formLabelWidth">
            <el-input v-model="stop.spaceName" autocomplete="off"></el-input>
          </el-form-item> -->
          <el-form-item label="开始时间" :label-width="formLabelWidth">
            <el-date-picker
              v-model="stop.statTime"
              format="yyyy-MM-dd HH:mm:ss"
              value-format="yyyy-MM-dd HH:mm:ss"
              type="date"
              placeholder="选择日期"
              style="width: 730px"
            ></el-date-picker>
          </el-form-item>
          <el-form-item label="截止时间" :label-width="formLabelWidth">
            <el-date-picker
              v-model="stop.endTime"
              format="yyyy-MM-dd HH:mm:ss"
              value-format="yyyy-MM-dd HH:mm:ss"
              type="date"
              placeholder="选择日期"
              style="width: 730px"
            ></el-date-picker>
          </el-form-item>
          <!-- <el-form-item label="状态" :label-width="formLabelWidth">
            <el-input v-model="stop.ifUser" autocomplete="off"></el-input>
          </el-form-item> -->
          <el-form-item label="状态" :label-width="formLabelWidth">
            <el-radio-group v-model="stop.ifUser">
              <el-radio label="售出"></el-radio>
              <el-radio label="闲置"></el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="总费用" :label-width="formLabelWidth">
            <el-input v-model="stop.total" autocomplete="off"></el-input>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible2 = false">取 消</el-button>
          <el-button type="primary" @click="add">添 加</el-button>
        </div>
      </el-dialog>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      fromLise: {},
      names1: {},
      username1: {},
      name: {},
      username: {},
      multipleSelection: [],
      dialogFormVisible2: false,
      dialogFormVisible: false, //开关模态窗体的状态
      formLabelWidth: "180px", //模态窗体标签显示的宽度
      currentPage: 1, //初始页
      pagesize: 20, //每页的数据
      park: {
        //绑定模态窗体个属性的对象
        id: "",
        comName: "",
        spaceNum: "",
        carCard: "",
        //  cardPicture :'',
        uname: "",
        tel: "",
        ifUser: "",
        total: "",
        creationTime: "",
        statTime: "",
        endTime: "",
      },
      stop: {
        comName: "",
        spaceNum: "",
        spaceName: "",
        creationTime: "",
        state: "",
      },
      useadd: {
        //绑定模态窗体个属性的对象
        comName: "",
        spaceNum: "",
        carCard: "",
        //  cardPicture :'',
        uname: "",
        tel: "",
        ifUser: "",
        total: "",
        statTime: "",
        endTime: "",
      },
      parks: [
        {
          //绑定模态窗体个属性的对象
          id: "",
          comName: "",
          spaceNum: "",
          carCard: "",
          //  cardPicture :'',
          uname: "",
          tel: "",
          ifUser: "",
          total: "",
          statTime: "",
          endTime: "",
          creationTime: "",
        },
        {
          //列表显示的对象（数组）
          id: 1,
          community: "金府花园",
          spaceNum: "dq001",
          spaceName: "东区1号",
          creationTime: "2020-01-01",
          state: "已使用",
        },
        {
          id: 1,
          community: "状元壹号",
          spaceNum: "dq002",
          spaceName: "东区2号",
          creationTime: "2022-01-01",
          state: "已使用",
        },
      ],
    };
  },
  // 该模块内部创建完成时执行created事件
  created() {
    this.getParks();
    this.getCommNames();
    this.getparkNames();
    this.getUserNames();
    this.getCarNames();
  },
  methods: {
    handleSelectionChange(val) {
      this.multipleSelection = val;
      console.log(this.multipleSelection);
    },
    flash: function () {
      location.reload();
    },
    handleSizeChange: function (size) {
      this.pagesize = size;
      console.log(this.pagesize); //每页下拉显示数据
    },
    handleCurrentChange: function (currentPage) {
      this.currentPage = currentPage;
      console.log(this.currentPage); //点击第几页
    },
    getParks() {
      // this.$message("ok");

      this.$axios
        .get("/use/parks")
        .then((res) => {
          // alert("12")
          if (res.data.code == 1) {
            this.parks.length = 0; //清空原有数组内容
            this.parks = res.data.info; //在空数组追加相应的数据
          }
        })
        .catch((error) => {
          console.log(error);
        });
    },
    getCommNames() {
      // this.$message("ok");
      // alert("ok");
      this.$axios
        .get("/comm/findComm")
        .then((res) => {
          // alert("12")
          if (res.data.code == 200) {
            // alert(res.data.data);
            this.names = res.data.data; //在空数组追加相应的数据
            this.names1 = res.data.data; //在空数组追加相应的数据
          }
        })
        .catch((error) => {
          console.log(error);
        });
    },
    getparkNames() {
      // this.$message("ok");
      // alert("ok");
      this.$axios
        .get("/parking/searchFree")
        .then((res) => {
          // alert("12")
          if (res.data.code == 1) {
            // alert(res.data.data);
            this.parkfree = res.data.info; //在空数组追加相应的数据
          }
        })
        .catch((error) => {
          console.log(error);
        });
    },
    getUserNames() {
      // this.$message("ok");
      // alert("ok");
      this.$axios
        .get("/owner/owners")
        .then((res) => {
          // alert("12")
          if (res.data.code == 200) {
            // alert(res.data.data);
            this.username = res.data.data; //在空数组追加相应的数据
            this.username1 = res.data.data; //在空数组追加相应的数据
          }
        })
        .catch((error) => {
          console.log(error);
        });
    },
    getCarNames() {
      // this.$message("ok");
      // alert("ok");
      this.$axios
        .get("/car/findCarAll")
        .then((res) => {
          // alert("12")
          if (res.data.code == 1) {
            // alert(res.data.data);
            this.carname = res.data.info; //在空数组追加相应的数据
          }
        })
        .catch((error) => {
          console.log(error);
        });
    },
    deleteChoose: function (i, r) {
      // alert("ggg");
      // alert(this.multipleSelection[1].id);
      let ids = "";
      if (this.multipleSelection.length == 0) {
        alert("至少选中一行");
      } else {
        for (let j = 0; j < this.multipleSelection.length; j++) {
          ids += this.multipleSelection[j].id + ",";
        }
        alert(ids);
        this.$axios
          .delete("/use/deleteChoose", {
            params: {
              ids: ids,
            },
          })
          .then((res) => {
            if (res.data.code == 1) {
              this.$message(res.data.message);
              for (let j = 0; j < this.multipleSelection.length; j++) {
                this.parks.splice(i, 1);
              }
            } else {
              this.$message(res.data.message);
            }
          })
          .catch((error) => {
            console.log(error);
          });
      }
    },
    handleEdit: function (i, r) {
      // alert(i+" "+r.id+"  "+r.spaceName);s
      // 更新模态窗体绑定的对象数据
      this.park.id = r.id;
      this.park.comName = r.community.comName;
      this.park.spaceNum = r.parking.spaceNum;
      this.park.carCard = r.car.carCard;
      // this.park.cardPicture = r.cardPicture;
      this.park.uname = r.owner.uname;
      this.park.tel = r.owner.tel;
      this.park.ifUser = r.ifUser;
      this.park.total = r.total;
      this.park.creationTime = r.parking.creationTime;
      this.park.statTime = r.statTime;
      this.park.endTime = r.endTime;
      // 显示模态窗体
      this.dialogFormVisible = true;
    },
    deleteOne: function (i, r) {
      if (confirm("是否删除？")) {
        // alert(r.id);
        this.$axios
          .delete("/use/deleteUse", {
            params: {
              id: r.id,
            },
          })
          .then((res) => {
            if (res.data.code == 1) {
              this.parks.splice(i, 1);
              this.$message(res.data.message);
            } else {
              this.$message(res.data.message);
            }
          })
          .catch((error) => {
            console.log(error);
          });
      }
    },

    addUse: function () {
      // alert("sss")
      this.dialogFormVisible2 = true;
    },
    add: function () {
      // alert(this.stop.community)
      this.$axios
        .post("/use/addUse", {
          carId: this.stop.car,
          ownerId: this.stop.owner,
          comId: this.stop.community,
          parkId: this.stop.parking,
          ifUser: this.stop.ifUser,
          statTime: this.stop.statTime,
          total: this.stop.total,
          endTime: this.stop.endTime,
        })
        .then((res) => {
          // alert(res.data.code)
          // 修改成功
          if (res.data.code == 1) {
            // alert(res.data.info.id);
            // alert(this.parks.id)
            // alert(this.park.id)
            // 修改成功后，遍历列表数组，用修改的对象数据更新原有数组中同id的对象数据
            // this.parks.push(res.data.info);
            let obj = this.parks[this.parks.length - 1];
            let newid = obj.id + 1;
            let comName = "";
            //小区
            let community = { id: this.stop.owner, uname: "" };
            for (let i = 0; i < this.names.length; i++) {
              if (this.names[i].id == this.stop.community) {
                comName = this.names[i].comName;
                community.comName = comName;
              }
            }
            //停车位
            let spaceName = "";
            let parking = { id: this.stop.parking, spaceName: "" };
            let creationTime = "";
            for (let i = 0; i < this.parkfree.length; i++) {
              if (this.parkfree[i].id == this.stop.parking) {
                spaceName = this.parkfree[i].spaceName;
                creationTime = this.parkfree[i].creationTime;
                parking.spaceName = spaceName;
                parking.creationTime = creationTime;
              }
            }
            //业主
            let uname = "";
            let tel = "";
            let owner = { id: this.stop.owner, uname: "", tel: "" };
            for (let i = 0; i < this.username.length; i++) {
              if (this.username[i].id == this.stop.owner) {
                uname = this.username1[i].uname;
                tel = this.username1[i].tel;
                owner.uname = uname;
                owner.tel = tel;
              }
            }
            //车辆
            let cardPicture = "";
            let carCard = "";
            let car = { id: this.stop.car, cardPicture: "", carCard: "" };
            for (let i = 0; i < this.carname.length; i++) {
              if (this.carname[i].id == this.stop.car) {
                cardPicture = this.carname[i].cardPicture;
                carCard = this.carname[i].carCard;
                car.cardPicture = cardPicture;
                car.carCard = carCard;
              }
            }
            // this.tableData.push({id:newid,community:comm,cname2:cname,comid:this.form2.community,bnum:this.form2.bnum,bname:this.form2.bname,bcount:this.form2.bcount,bdescript:this.form2.bdescript,createtime:this.form2.createtime},
            //          );
            this.parks.push({
              id: newid,
              carId: this.stop.car,
              car: car,
              ownerId: this.stop.owner,
              owner: owner,
              comId: this.stop.community,
              community: community,
              parkId: this.stop.parking,
              parking: parking,
              ifUser: this.stop.ifUser,
              statTime: this.stop.statTime,
              total: this.stop.total,
              endTime: this.stop.endTime,
            });
            this.$message(res.data.message);
            this.dialogFormVisible2 = false;
            //  location.reload();
          } else {
            this.dialogFormVisible2 = false;
            this.$message(res.data.message);
          }
        })
        .catch((error) => {});
      this.dialogFormVisible9 = false;
    },
    onLikeFind: function () {
      //  alert(this.fromLise.comId);
      // alert(this.fromLise.ownerId);
      this.$axios
        .post("/use/findLike", {
          comId: this.fromLise.comId,
          ownerId: this.fromLise.ownerId,
        })
        .then((res) => {
          if (res.data.code == 1) {
            this.parks = res.data.info;
            console.log(this.parks);
          } else {
            this.$message(res.data.message);
          }
        })
        .catch((error) => {
          console.log(error);
        });
    },

    // id:this.park.id,
    // comName:this.park.comName,
    // spaceNum:this.park.spaceNum,
    // carCard:this.park.carCard,
    // // :this.park.cardPicture,
    // uname:this.park.uname,
    // tel:this.park.tel,
    // ifUser:this.park.ifUser,
    // total:this.park.total,
    // creationTime:this.park.creationTime,
    // statTime:this.park.statTime,
    // endTime:this.park.endTime,
    updatePark: function () {
      // 像后端发出修改请求
      this.$axios
        .put("/use/updateUse", {
          id: this.park.id,
          carCard: this.park.carCard,
          // cardPicture:this.park.cardPicture,
          uname: this.park.uname,
          ifUser: this.park.ifUser,
          total: this.park.total,
          statTime: this.park.statTime,
          endTime: this.park.endTime,
        })
        .then((res) => {
          // alert(res.data.code)
          // 修改成功
          if (res.data.code == 1) {
            // alert(res.data.info.id);
            // alert(this.parks.id)
            // alert(this.park.id)
            // 修改成功后，遍历列表数组，用修改的对象数据更新原有数组中同id的对象数据
            for (var i = 0; i < this.parks.length; i++) {
              if (this.parks[i].id == this.park.id) {
                // alert("qq");
                this.parks[i].community.comName = this.park.comName;
                this.parks[i].parking.spaceNum = this.park.spaceNum;
                this.parks[i].car.carCard = this.park.carCard;
                // this.park.cardPicture = this.park.cardPicture;
                this.parks[i].owner.uname = this.park.uname;
                this.parks[i].owner.tel = this.park.tel;
                this.parks[i].ifUser = this.park.ifUser;
                this.parks[i].total = this.park.total;
                this.parks[i].parking.creationTime = this.park.creationTime;
                this.parks[i].statTime = this.park.statTime;
                this.parks[i].endTime = this.park.endTime;
              }
            }
          } else {
            this.dialogFormVisible = false;
            this.$message(res.data.message);
          }
        })
        .catch((error) => {});
      this.dialogFormVisible = false;
    },
  },
};
</script>
<style >
#div1 {
  height: 50px;
  line-height: 50px;
}
#topdiv {
  height: 50px;
}
#div2 {
  float: left;
}
#div3 {
  float: right;
  line-height: 20px;
}
#p1 {
  font-size: 15px;
  float: left;
}

#we {
  height: 50px;
  line-height: 30px;
  font-size: 18px;
}
#vv {
  line-height: 30px;
  float: right;
}
#divtable .el-table__header th,
#divtable .el-table__header tr {
  background-color: beige;
}
#bb {
  margin-top: 10px;
  float: left;
}
#divtable {
  line-height: 40px;
}
</style> 